#include <stdio.h>

// 二维数组的指针
int main() {
    int a[3][4] = {
            {1, 2,  3,  4},
            {5, 6,  7,  8},
            {9, 10, 11, 12}
    }, i, j, sum = 0;
    //定义二维数组的指针
    int (*p)[4] = &a[0];
    sum = 0;
    for (i = 0; i < 3; i++, p++)
        for (j = 0; j < 4; j++)
            sum = sum + (*p)[j];

    printf("sum = %d\n", sum);
}